<template>
	<el-card shadow="never" class="fornt_index_card">
		<template slot="header" v-if="!!title">
			{{ title }}
			<el-button type="text" @click="handleRouterTo()" v-if="!!to">
				更多
				<i class="el-icon-d-arrow-right"></i>
			</el-button>
		</template>
		<slot></slot>
	</el-card>
</template>

<script>
export default {
	props: {
		title: { type: String, default: '' },
		to: { type: String, default: '' }
	},
	methods: {
		handleRouterTo() {
			this.$router.push({ path: this.to });
		}
	}
};
</script>

<style lang="scss" scoped>
.el-card.fornt_index_card {
	height: 100%;
	&:deep(.el-card__header) {
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-weight: bold;
		font-size: 20px;
		line-height: 1;
		padding: 16px;
		.el-button {
			display: flex;
			padding: 0;
			line-height: 1;
			font-size: 16px;
		}
	}
	&:deep(.el-card__body) {
		padding: 0;
	}
}
</style>
